Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Add option support for native NCHW input data format. #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghostplant
Copy link

Fixing the issue: #267

Note: If not specifying --input_data_format=NCHW manually, all existing logic keeps unchanged.

@reedwm
Copy link
Member

reedwm commented Nov 16, 2018

Can you clarify what this PR does? With --input_data_format, you move the transpose logic to another part of the code, but you still do the transpose.

@ghostplant
Copy link
Author

@reedwm Hi, it is a good question. Because it is possible to generate the input in NCHW format directly such as dataset.from_tensor/from_generator and other kind of pre-processed data, which would be faster during training and inference in terms of performance and it also costs less GPU memory and also CPU memory since we no longer need a useless format conversion.
For this commit, it allows the model to accept NCHW input format without twice time of format conversion on GPU(or CPU), and in the future I could add the case of feeding NCHW input data for this case once it is accepted. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants